<!DOCTYPE html>

<link rel="stylesheet" href="/css/layui.css" media="all">

<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include::header"></head>
<style type="text/css">
    /*.top1 img, .top2 img, .top3 img, .top4 img, .top5 img {*/
    /*float: left;*/
    /*}*/
    .main {
        /*text-align: center;*/
        margin: 20px auto;
        /*background: url("/static/images/bc.png");*/
        /*background-repeat: repeat-x;*/
        /*background-color: lightblue;*/
        width: 500px;
        height: 450px;
    }
    #time {
        cursor: not-allowed;
    }
</style>
<div class="main">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">基本情况</label>
            <div class="layui-input-block">
                <input type="text" name="machine" required lay-verify="required" placeholder="基本情况" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">维修履历</label>
            <div class="layui-input-block">
                <input type="text" name="machine" required lay-verify="required" placeholder="机号" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">保养履历</label>
            <div class="layui-input-block">
                <input type="text" name="appearance" required lay-verify="required" placeholder="保养履历" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">保养计划</label>
            <div class="layui-input-block">
                <input type="text" name="solution" required lay-verify="required" placeholder="保养计划" autocomplete="off"
                       class="layui-input">
            </div>
        </div>

        <div class="layui-form-item" >
            <label class="layui-form-label" style="width: 100px;padding-left: 0;">保养计划预警</label>
            <div class="layui-input-block" id="time_warn">
                <input type="checkbox" name="time_warn" lay-skin="switch" id="checkbox">
            </div>

        </div>
        <div class="layui-form-item" id="prepare_time" style="display: none">

            <div class="layui-input-block">
                <input type="text" name="" lay-verify="" placeholder="下次保养时间" autocomplete="off"
                       class="layui-input" id="input_time">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo" style="padding:0 50px;float: right ">立即提交
                </button>
                <!--<button class="layui-btn layui-btn-primary" lay-close id="cancel">取消</button>-->

            </div>

        </div>
    </form>
</div>


<div th:replace="include::footer"></div>
<script type="text/javascript" src="/js/plugins/laydate/laydate.js"></script>
<script src="/js/layui.js" charset="utf-8"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/device/util.js"></script>
<script type="text/javascript" src="/js/device/report.js"></script>
<script type="text/javascript">
    layui.use(['table'], function () {
        var form = layui.form;
        init();
//        本地时间
        var now_time = dataFormat(new Date(), "yyyy-MM-dd HH:mm");
//        alert(t)
        $("#time").val(now_time);
//        $("#id_text").val();
//        console.log($("#time"))
//        时间选择器
        laydate.render({
            elem: '#input_time',
            type: 'datetime',
            min: now_time
        });
//        提交事件
        form.on('submit(formDemo)', function (data) {
            layer.msg(JSON.stringify(data.field));
            setTimeout(
                "parent.window.location.reload()"
                , 2000);

            return false;
        });
    });
</script>
</html>